﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyOA.DAL;
using MyOA.Model;

namespace MyOA.BLL
{
   public class DepartScheduleManage
    {
       DepartScheduleService service = new DepartScheduleService();

        /// <summary>
        /// 获取全部的机构信息
        /// </summary>
        /// <returns>获取全部的机构信息</returns>
       public IList<BranchInfo> getAllBranchInfo()
       {
           return service.getAllBranchInfo();
       }

       /// <summary>
       /// 根据机构ID获取相应的部门信息
       /// </summary>
       /// <param name="branchId">机构ID</param>
       /// <returns>部门信息集合</returns>
       public IList<DepartInfo> getDepartInfoByBranchId(int branchId)
       {
           return service.getDepartInfoByBranchId(branchId);
       }

       /// <summary>
        /// 通过关键字搜索登陆名
        /// </summary>
        /// <param name="keyWord">关键字</param>
        /// <returns>获得的登录名集合</returns>
       public IList<string> getLoginIdByKeyWord(string keyWord)
       {
           return service.getLoginIdByKeyWord(keyWord);
       }

       /// <summary>
        /// 根据多个不同条件来查找日程
        /// 注：部门ID为必须条件
        /// 如果不根据用户ID查找则设置USERID=0
        /// 如果不根据时间查找则设置DT=1900-1-1 0：00：00
        /// </summary>
        /// <param name="departId">条件:部门ID</param>
        /// <param name="userId">条件：用户ID</param>
        /// <param name="dt">条件：时间</param>
        /// <returns></returns>
       public IList<Schedule> getScheduleByMoreTerm(int departId, int userId, DateTime dt)
       {
           return service.getScheduleByMoreTerm(departId, userId, dt);
       }

       /// <summary>
       /// 根据用户登陆名获取用户ID
       /// </summary>
       /// <param name="loginId">用户登陆名</param>
       /// <returns>用户ID</returns>
       public int getUserIdByLoginId(string loginId)
       {
           return service.getUserIdByLoginId(loginId);
       }
    }
}
